#ifndef RSPHEADERRECVHANDLERBASE_H
#define RSPHEADERRECVHANDLERBASE_H

#include "ITransHandler.h"
#include "InsteadHttpUrl.h"
#include "Log.h"

class RspHeaderRecvHandlerBase:public ITransHandler
{
public:
	RspHeaderRecvHandlerBase():ITransHandler(){}

	~RspHeaderRecvHandlerBase(){}

	virtual ExecuteResultCode Execute(ClientContext&,OVERLAPPED*);

protected:
	virtual void GetRecvInfo(ClientContext &client,SOCKET *recvSock,WSABUF **recvBuffer,OVERLAPPED **recvOvl,HttpResponseHeader **responseHeader) abstract;

	virtual ExecuteResultCode OnHeaderReceiveCompleted(ClientContext &client,OVERLAPPED *ovl,HttpResponseHeader &headerData);

	virtual ExecuteResultCode OnExecuteError(ClientContext&,OVERLAPPED*,ExecuteResultCode) abstract;

	virtual ExecuteResultCode OnSendResponseHeader(ClientContext&,HttpResponseHeader&);

	virtual ITransHandler* GetNextHandler() abstract;

private:
	static log4cplus::Logger log;
};

#endif